Skip to content

Conversation

LysandreJik
Copy link
Member

Enables passing chat template parameters as follows:

lighteval accelerate \
    model_name=Qwen/Qwen2.5-0.5B-Instruct,generation_parameters={temperature:1,top_p:1},chat_template_parameters={reasoning_effort:low} \
    leaderboard|truthfulqa:mc|0|0

It can probably be simplified and needs tests.

@HuggingFaceDocBuilderDev
Copy link
Collaborator

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Member

@clefourrier clefourrier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good - will also need to be added to the logger, most likely GeneralConfigLogger

matches = pattern.findall(args)
for key, value in matches:
key = key.strip()
if key == "generation_parameters":
gen_params = re.sub(r"(\w+):", r'"\1":', value)
generation_parameters_dict = json.loads(gen_params)
if key == "chat_template_parameters":
# Chat template parameters have strings as values that also need to be quoted
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be relevant to have tests for parsing edge cases

@NathanHB
Copy link
Member

helpful for #855

@@ -87,6 +87,7 @@ class GeneralConfigLogger:
model_size: str = None

generation_parameters: dict | None = None
chat_template_parameters: dict | None = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turbo nit, but perhaps it's better to call this chat_template_kwargs to align with vLLM and TRL?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants